const _antiShake = () => {
  let timer = null;
  return (f, t = 300) => {
    if (timer) clearTimeout(timer);
    timer = setTimeout(() => {
      f && f();
      clearTimeout(timer);
      timer = null;
    }, t);
  };
};
/**
 * 防抖函数
 */
const antiShake = _antiShake();
export default antiShake;
